create table VisaPrice
(
	 [VisaPriceId] int identity(1, 1) primary key
	,[VisaId] int
	,[VisaTypeId] int
	,[RegisterNational] int
	,[NationalId] int
	,[Price] decimal
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

CREATE PROCEDURE VisaPriceGet
	@VisaPriceId int
AS
SELECT *
FROM [VisaPrice]
WHERE [VisaPrice].[VisaPriceId] = @VisaPriceId
GO

CREATE PROCEDURE VisaPriceList
AS
SELECT *
FROM [VisaPrice]
ORDER BY VisaPriceId DESC
GO

CREATE PROCEDURE VisaPriceInsert
	@VisaId int
	,@VisaTypeId int
	,@RegisterNational int
	,@NationalId int
	,@Price decimal(18, 0)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO VisaPrice (
	 [VisaId]
	,[VisaTypeId]
	,[RegisterNational]
	,[NationalId]
	,[Price]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @VisaId
	,@VisaTypeId
	,@RegisterNational
	,@NationalId
	,@Price
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
	
)

select SCOPE_IDENTITY()
GO

CREATE PROCEDURE VisaPriceUpdate
	@VisaPriceId int, 
	@VisaId int, 
	@VisaTypeId int, 
	@RegisterNational int, 
	@NationalId int, 
	@Price decimal(18, 0), 
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE VisaPrice SET
	   [VisaId] = @VisaId
	   ,[VisaTypeId] = @VisaTypeId
	   ,[RegisterNational] = @RegisterNational
	   ,[NationalId] = @NationalId
	   ,[Price] = @Price
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [VisaPrice].[VisaPriceId] = @VisaPriceId
GO

CREATE PROCEDURE VisaPriceDelete
	@VisaPriceId int
AS
DELETE FROM VisaPrice
WHERE [VisaPrice].[VisaPriceId] = @VisaPriceId
GO